home *** CD-ROM | disk | FTP | other *** search
-
-
-
- READ(3) MINTLIB LIBRARY FUNCTIONS READ(3)
-
-
- N✓NA✓AM✓ME✓E
- read - read input
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- #include <unistd.h>
-
- int read(int fd, void *buffer, unsigned int length);
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- read attempts to read length bytes of data from the file
- referenced by the descriptor fd into the buffer pointed to
- by buffer.
-
- On objects capable of seeking, the read starts at a posi-
- tion given by the pointer associated with fd (see lseek).
- Upon return from read, the pointer is incremented by the
- number of bytes actually read.
-
- Objects that are not capable of seeking always read from
- the current position. The value of the pointer associated
- with such an object is undefined.
-
- Upon successful completion, read returns the number of
- bytes actually read and placed in the buffer. The system
- guarantees to read the number of bytes requested if the
- descriptor references a normal file which has that many
- bytes left before the EOF (end of file), but in no other
- case.
-
- If nbytes is not zero and read returns 0, then EOF has
- been reached.
-
- If the descriptor or the object is marked for non-blocking
- I/O, and less data are available than are requested by the
- read, only the data that are available are returned, and
- the count indicates how many bytes of data were actually
- read.
-
- R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
- read returns the number of bytes actually read on success.
- On failure, it returns -1 and sets errno to indicate the
- error.
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- d✓du✓up✓p(✓(3✓3)✓),✓, f✓fc✓cn✓nt✓tl✓l(✓(3✓3)✓),✓, i✓io✓oc✓ct✓tl✓l(✓(3✓3)✓),✓, l✓ls✓se✓ee✓ek✓k(✓(3✓3)✓),✓, o✓op✓pe✓en✓n(✓(3✓3)✓),✓, p✓pi✓ip✓pe✓e(✓(3✓3)✓)
-
-
-
-
-
-
-
-
-
-
-
-
- MiNT docs 0.1 3 March 1993 1
-
-
-